import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.*; 
import javax.swing.filechooser.FileNameExtensionFilter;


public class Writing extends JPanel {

		//Reference to canvas
		Canvas myCanvas;
		
		String[] wordStrings = {"-----","ZEBRA","LEARN","FINGER","SPECIAL","PHONE","EIGHT","MOUSE"};
		final JComboBox buttonword = new JComboBox(wordStrings);
		
		public Writing(Canvas aCanvas){
			myCanvas = aCanvas;
			setBackground(Color.white);
		}
	
		
		public void init(){
			
			//top selection
			JLabel label = new JLabel("Word Choice");
			add(label);

			buttonword.setSelectedIndex(0);
			add(buttonword);
			
			JButton generate = new JButton("Update");
			generate.addActionListener(new ActionListener() {
		         
				@Override
				public void actionPerformed(ActionEvent arg0) {
					String word = (String)(buttonword.getSelectedItem());
					myCanvas.drawCards(word);
				}
		       });
			add(generate);
			
		}
		
		public void reset(){
			buttonword.setSelectedIndex(0);
		}
		
		
}
